package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.ListData;
import com.cskaoyan.bean.User;
import com.cskaoyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/user")
public class AdminUserController {

    @Autowired
    UserService userService;

    @RequestMapping("list")
    public BaseRespVo list(Integer page, Integer limit, String sort, String order,String username,String mobile) {
        ListData<User> listData = userService.queryList(page, limit, sort, order,username,mobile);
        return BaseRespVo.ok(listData);
    }

    @RequestMapping("query1/{username}")
    public BaseRespVo queryUser1(@PathVariable("username") String username){

        return BaseRespVo.ok(userService.queryUserDollar(username));
    }
    @RequestMapping("query2/{username}")
    public BaseRespVo queryUser2(@PathVariable("username") String username){

        return BaseRespVo.ok(userService.queryUserJing(username));
    }
}
